﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Day03
{
    public class Grenade:IThrowable,IComparable
    {
        private int a;
        public int A {
            get { return a;}
            set { a = value; }
        }
        public int ATK { get; set; }
        public int AttackDistance { get; set; }
        //定义排序的依据
        public int CompareTo(object obj)
        {
            //按攻击力排序
            //当前与另外一个同类型元素进行比较
            //返回-1表示小于 this obj
            //返回0表示相等 相等
            //返回1表示大于 obj this
            Grenade param = obj as Grenade;
            return this.ATK.CompareTo(param.ATK);
        }

        public void Fly()
        {
            Console.WriteLine("手雷飞出");
        }
    }
}